import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const router = new VueRouter({
    routes: [
        {
            name:'Index',
            path:'/index',
            component:()=>import('@/views/index/index')
        },
        {
            name:'Login',
            path:'/login',
            component:()=>import('@/views/login/index')
        },
        {
            name:'Enter',
            path:'/enter',
            component:()=>import('@/views/enter/index')
        },
        {
            name:'Identify',
            path:'/identify',
            component:()=>import('@/views/identify/index')
        },
        {
            name:'Ecode',
            path:'/ecode',
            component:()=>import('@/views/e-code/index')
        },
        {
            name:'404',
            path:'/404',
            component:()=>import('@/views/error-page/404')
        },
        { path: '*'}
    ]
});
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}
export default router;
